import path from 'path';
import resolve from '@rollup/plugin-node-resolve';
import babel from 'rollup-plugin-babel';
import typescript from 'rollup-plugin-typescript2';
import commonjs from 'rollup-plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
//import pkg from './package.json';

const paths = {
  input: path.join(__dirname, '/components/index.tsx'),
  output: path.join(__dirname, '/dist'),
};

export default {
	input: paths.input,
	output: [
		{
            file: './lib/ygbh.js',
            format: 'umd',
            name: 'ygbh'
        },
	],
	plugins: [
		postcss({
            extract:true,
            extract: path.resolve('./lib/ygbh.css')
        }),
		typescript(),
		babel(),
		commonjs({ include: /node_modules/ }),
		resolve(),
	],
	external: ['react', 'react-dom'],
};
